package com.bjpowernode.compare;

import com.bjpowernode.beans.Stu;

import java.util.Comparator;

public class StuSexCompare implements Comparator<Stu> {
    @Override
    public int compare(Stu o1, Stu o2) {
        //如果返回的对象内部已经有比较器，则直接使用
        return o1.getSex().compareTo(o2.getSex());
    }
}
